package per.hx.bs.yw.serviceimpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import per.hx.bs.entity.yw.YwSignDO;
import per.hx.bs.yw.dao.YwSignDao;

import java.util.List;
import java.util.Map;

/**
 * @author HuXing
 * @date 2018/4/20  7:58
 */
@Transactional(rollbackFor = Exception.class)
@RestController
@RequestMapping(value = "yw-service/sign")
public class YwSignApiServiceImpl {
    private final
    YwSignDao signDao;

    @Autowired
    public YwSignApiServiceImpl(YwSignDao signDao) {
        this.signDao = signDao;
    }

    /**
     * 按条件获取考勤信息
     *
     * @param map 条件
     * @return 考勤信息
     */
    @PostMapping(value = "/signList")
    public List<YwSignDO> signList(@RequestBody Map<String, Object> map) {
        return signDao.signList(map);
    }

    /**
     * 按条件获取考勤信息数量
     *
     * @param map 条件
     * @return 考勤信息数量
     */
    @PostMapping(value = "/signCount")
    public int signCount(@RequestBody Map<String, Object> map) {
        return signDao.signCount(map);
    }
}
